<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
    new Promise((resolve, reject)=>{
        let x
        setTimeout(()=>{
            x=1
        },1000)
        resolve(x)
    }).then(value => {
        console.log(value)
    })
</script>
</body>
</html>